<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // split 进行字符串切分，返回结果为数组
    const str = '12-sfd-56-dddd'
    const arr = str.split('-')

    alert(arr)
  </script>
</body>
</html>